/*
 * =====================================================================================
 *
 *       Filename:  conf.h
 *
 *    Description:  AmazOne conf access class
 *
 *        Version:  1.0
 *        Created:  Wednesday, March 21, 2012 11:18:08 HKT
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  mikejiang (mj), ysjiang.bak at gmail dot com
 *        Company:  Tencent
 *
 * =====================================================================================
 */
#ifndef _AMAZONE_CONF_H_
#define _AMAZONE_CONF_H_ 

#include "comm.h"

namespace Amz { 

class Conf {

public:
    Conf (const char* path = NULL);
    virtual ~Conf ();
    
    int getLogMode()
    { 
        return this->logMode_;
    }
    int setLogMode(int mod = AMZ_DEFAULT_LOG_MODE);
    
    int getLogLevel() 
    { 
        return this->logLevel_;
    }
    int setLogLevel(int level = AMZ_DEFAULT_LOG_LEVEL);
    
    const char* getLogDir()
    { 
        return this->logDir_;
    }
    int setLogDir(const char* dir = AMZ_DEFAULT_LOG_DIR);

    const char* getServerHost()
    {
        return this->svrHost_;
    }
    int setServerHost(const char* host = AMZ_DEFAULT_HOST);
    
    int getServerPort()
    {
        return this->svrPort_;
    }
    int setServerPort(int port = AMZ_DEFAULT_PORT);

private:
    char path_[AMZ_MAX_PATH_LEN + 1];

    int logLevel_;
    char* logDir_;
    int logMode_;

    int svrPort_;
    char* svrHost_;
};
 
}
#endif

